package com.sporteamws;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class MessageReceivedActivity extends Activity
{
	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		Bundle extras = getIntent().getExtras();
		String payload,info,sender;
		if (extras != null) 
		{
			payload = extras.getString("payload");
			if(payload != null && payload.length() > 0)
			{
				info = GetInfoFromStr(payload);
				if(info.equals("track"))
				{
					//setContentView(com.sporteamws.R.layout.activities);
				}
			}
			
			//if (message != null && message.length() > 0) 
			//{
			//	TextView view = (TextView) findViewById(com.sporteamws.R.id.result);
		   //		view.setText(message);
			//}
			
		}
		
		
		

		super.onCreate(savedInstanceState);
	}

private String GetInfoFromStr(String str)
{
	StringBuilder msgInfo = new StringBuilder();
	for(int i = 0; i < str.length(); i++)
	{
		if(str.charAt(i) == ';') 
			break;
		else
			msgInfo.append(str.charAt(i));
	}
	
	return msgInfo.toString();
}

private String GetAditionalFromStr(String str)
{
	StringBuilder additional = new StringBuilder();
	int counter = 0;
	for(int i = 0; i < str.length(); i++)
	{
		if(str.charAt(i) == ';'){
			if(counter == 1)
				break;
			else
			    counter++;
		}
		else if(counter == 1){
			additional.append(str.charAt(i));
		}
	}
	
	return additional.toString();
}

}